package com.juc.threadPoolExecutor.threadPoolExecutor3;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class Test3 {

	public static void main(String[] args) throws InterruptedException {
		MyRunnable2 myRunnable =  new MyRunnable2();
		ThreadPoolExecutor executor = new ThreadPoolExecutor(2, 99999, 9999L, TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>());
		executor.execute(myRunnable);
		executor.execute(myRunnable);
		executor.execute(myRunnable);
		executor.execute(myRunnable);
		Thread.sleep(1000);
		executor.shutdownNow();
		executor.execute(myRunnable);
		System.out.println("main end !");
	}
}
